package com.rasenhund.android.grecorder.schema;



/**
 * カテゴリ別出撃回数格納用クラス
 */
public class CategoryCount {
    
    private int total = 0;

    private int grapp = 0;
    private int prox = 0;
    private int shoot = 0;
    private int cannon = 0;
    private int snipe = 0;

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getGrapp() {
        return grapp;
    }

    public void setGrapp(int grapp) {
        this.grapp = grapp;
    }

    public int getProx() {
        return prox;
    }

    public void setProx(int prox) {
        this.prox = prox;
    }

    public int getShoot() {
        return shoot;
    }

    public void setShoot(int shoot) {
        this.shoot = shoot;
    }

    public int getCannon() {
        return cannon;
    }

    public void setCannon(int cannon) {
        this.cannon = cannon;
    }

    public int getSnipe() {
        return snipe;
    }

    public void setSnipe(int snipe) {
        this.snipe = snipe;
    }

    /**
     * 格闘カテゴリの出撃割合を取得
     * 
     * @param max 上限値
     * @return
     */
    public int getGrappPer(int max) {
        if (this.total == 0)
            return 0;
        return (int) ((float) this.grapp / (float) this.total * max);
    }

    /**
     * 近接カテゴリの出撃割合を取得
     * 
     * @param max 上限値
     * @return
     */
    public int getProxPer(int max) {
        if (this.total == 0)
            return 0;
        return (int) ((float) this.prox / (float) this.total * max);
    }

    /**
     * 射撃カテゴリの出撃割合を取得
     * 
     * @param max 上限値
     * @return
     */
    public int getShootPer(int max) {
        if (this.total == 0)
            return 0;
        return (int) ((float) this.shoot / (float) this.total * max);
    }

    /**
     * 遠距離カテゴリの出撃割合を取得
     * 
     * @param max 上限値
     * @return
     */
    public int getCannonPer(int max) {
        if (this.total == 0)
            return 0;
        return (int) ((float) this.cannon / (float) this.total * max);
    }

    /**
     * 狙撃カテゴリの出撃割合を取得
     * 
     * @param max 上限値
     * @return
     */
    public int getSnipePer(int max) {
        if (this.total == 0)
            return 0;
        return (int) ((float) this.snipe / (float) this.total * max);
    }

}
